/*
 * BSM6.0
 *
 * Copyright 2012-2013 (C) SINODATA CO., LTD. All Rights Reserved.
 */
package com.sinodata.bsm.center.service.fault;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.sinodata.bsm.center.bean.Condition;
import com.sinodata.bsm.center.bean.Page;
import com.sinodata.bsm.center.dao.BaseDao;
import com.sinodata.bsm.center.dao.impl.TrapDaoImpl;
import com.sinodata.bsm.common.vo.FaultTrapMsg;

/**
 * <p>
 * Description: 
 * </p>
 *
 * @author wangyazhou
 * @version 1.0

 * <p>
 * History: 
 *
 * Date                     Author         Version     Description
 * ---------------------------------------------------------------------------------
 * 2012-12-10 上午11:16:37          wangyazhou        1.0         To create
 * </p>
 *
 * @since 
 * @see     
 */
@Service
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public class TrapService {

    @Autowired
    private BaseDao baseDao;

    @Autowired
    private TrapDaoImpl trapDao;

    /**
     * 
     * 
     * @param trap
     */
    public void save(FaultTrapMsg trap) {
        baseDao.saveOrUpdate(trap);
    }

    /**
     * 批量保存trap数据
     * @param trapList
     */
    public void batchSave(List<FaultTrapMsg> trapList) {
        baseDao.batchSaveOrUpdate(trapList);
    }

    public Page<FaultTrapMsg> findByPage(Page<FaultTrapMsg> page, Condition condition) {
        return trapDao.findByPage(page, condition);
    }

}
